package lib.streamapi;

import com.google.common.collect.Lists;
import org.junit.Test;

import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;

public class StreamTest {

    @Test
   public void test() {
        List<String> list = Lists.newArrayList("blog.didispace.com", "spring4all.com", "openwrite.cn", "www.didispace.com");

        List<String> result = list.stream()
                .filter(e -> e.contains("didispace.com"))
                .filter(e -> e.length() > 17)
                .collect(Collectors.toList());

        System.out.println(result);
    }

}